USE [GD1C2012]
GO

/****** Object:  Table [SUPERACIDOS].[Viaje]    Script Date: 06/11/2012 09:26:25 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [SUPERACIDOS].[Viaje](
	[Viaje_Id] [int] IDENTITY(1,1) NOT NULL,
	[Viaje_Cant_Fichas] [numeric](18, 0) NULL,
	[Viaje_Fecha] [datetime] NULL,
	[Viaje_ClienteId] [int] NULL,
	[Viaje_ChoferId] [int] NOT NULL,
	[Viaje_AutoId] [int] NOT NULL,
	[Viaje_TurnoId] [int] NOT NULL,
	[Viaje_TipoViajeId] [int] NOT NULL,
 CONSTRAINT [PK_Viaje] PRIMARY KEY CLUSTERED 
(
	[Viaje_Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [SUPERACIDOS].[Viaje]  WITH CHECK ADD  CONSTRAINT [FK_Viaje_Auto] FOREIGN KEY([Viaje_AutoId])
REFERENCES [SUPERACIDOS].[Auto] ([Auto_Id])
GO

ALTER TABLE [SUPERACIDOS].[Viaje] CHECK CONSTRAINT [FK_Viaje_Auto]
GO

ALTER TABLE [SUPERACIDOS].[Viaje]  WITH CHECK ADD  CONSTRAINT [FK_Viaje_Chofer] FOREIGN KEY([Viaje_ChoferId])
REFERENCES [SUPERACIDOS].[Chofer] ([Chofer_Id])
GO

ALTER TABLE [SUPERACIDOS].[Viaje] CHECK CONSTRAINT [FK_Viaje_Chofer]
GO

ALTER TABLE [SUPERACIDOS].[Viaje]  WITH CHECK ADD  CONSTRAINT [FK_Viaje_Cliente] FOREIGN KEY([Viaje_ClienteId])
REFERENCES [SUPERACIDOS].[Cliente] ([Cliente_Id])
GO

ALTER TABLE [SUPERACIDOS].[Viaje] CHECK CONSTRAINT [FK_Viaje_Cliente]
GO

ALTER TABLE [SUPERACIDOS].[Viaje]  WITH CHECK ADD  CONSTRAINT [FK_Viaje_Tipo_Viaje] FOREIGN KEY([Viaje_TipoViajeId])
REFERENCES [SUPERACIDOS].[Tipo_Viaje] ([TiVi_Id])
GO

ALTER TABLE [SUPERACIDOS].[Viaje] CHECK CONSTRAINT [FK_Viaje_Tipo_Viaje]
GO

ALTER TABLE [SUPERACIDOS].[Viaje]  WITH CHECK ADD  CONSTRAINT [FK_Viaje_Turno] FOREIGN KEY([Viaje_TurnoId])
REFERENCES [SUPERACIDOS].[Turno] ([Turno_Id])
GO

ALTER TABLE [SUPERACIDOS].[Viaje] CHECK CONSTRAINT [FK_Viaje_Turno]
GO

